package cmgine.com.testqq.TabBar;

import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.widget.TabHost;

import cmgine.com.testqq.R;

public class TabActivity extends android.app.TabActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_tab);

        TabHost tabHost = getTabHost();

        Intent intent1 = new Intent();
        intent1.setClass(this, MessageActivity.class);
        TabHost.TabSpec spec1 = tabHost.newTabSpec("消息");
        spec1.setIndicator("消息", getResources().getDrawable(R.drawable.abc_ic_search));
        spec1.setContent(intent1);
        tabHost.addTab(spec1);

        Intent intent2 = new Intent();
        intent2.setClass(this, ContactActivity.class);
        TabHost.TabSpec spec2 = tabHost.newTabSpec("联系人");
        spec2.setIndicator("联系人", getResources().getDrawable(R.drawable.abc_ic_search));
        spec2.setContent(intent2);
        tabHost.addTab(spec2);

        Intent intent3 = new Intent();
        intent3.setClass(this, NewsActivity.class);
        TabHost.TabSpec spec3 = tabHost.newTabSpec("动态");
        spec3.setIndicator("动态", getResources().getDrawable(R.drawable.abc_ic_search));
        spec3.setContent(intent3);
        tabHost.addTab(spec3);
    }


}
